package com.vancouver.knows.ui.activity.login;

import com.vancouver.knows.R;

import android.app.ProgressDialog;
import android.content.Context;

public class LoadingDialog {
	
	private ProgressDialog dialog;
	
	public LoadingDialog(Context context){
		dialog = new ProgressDialog(context, R.style.MyAlertDialogStyle);
		dialog.setTitle("");
		dialog.setIndeterminate(false);
		//dialog.setCancelable(true);
	}
	
	public void showLoadingDialog(String msg) {
		if (dialog != null) {
			dialog.setMessage(msg);
			dialog.show();
		}
	}
	
	public void closeLoadingDialog(){
		if (dialog != null && dialog.isShowing()) {
			dialog.hide();
		}
	}

	public void dismiss() {
		if (dialog != null && dialog.isShowing()) {
			dialog.dismiss();
		}
		
	}
}